package sk.ygor.xtemplate.example;

import sk.ygor.xtemplate.XTemplate;

import java.util.Arrays;

/**
 * User: ygor
 * Date: 31.12.2008
 * Time: 21:21:37
 */
public class XTemplateExample {
    public static void main(String[] args) {
        XTemplate template = new XTemplate("sk/ygor/xtemplate/example/SomeTemplate.xtpl");
        template.assign("title", "List of members");
        {
            {
                template.assign("memberName", "Elvis");
                template.assign("memberColors", "black");
                template.parse("members.member");
            }
            {
                template.assign("memberName", "Madonna");
                template.assign("memberColors", Arrays.asList("red", "pink", "yellow"));
                template.parse("members.member");
            }
            template.parse("members");
        }
        template.parse();
//        System.out.println("template.getText() = " + template.getText());
    }
}
